import { Column, Entity, Index } from "typeorm";

@Index("idx_sr_role_code", ["roleCode"], {})
@Index("uniq_sys_role_role_code", ["roleCode"], { unique: true })
@Entity("sys_role", { schema: "workflow" })
export class SysRole {
    @Column("char", { primary: true, name: "id", comment: "主键id", length: 36 })
    id: string;

    @Column("varchar", {
        name: "role_name",
        nullable: true,
        comment: "角色名称",
        length: 200,
    })
    roleName: string | null;

    @Column("varchar", {
        name: "role_code",
        unique: true,
        comment: "角色编码",
        length: 100,
    })
    roleCode: string;

    @Column("varchar", {
        name: "description",
        nullable: true,
        comment: "描述",
        length: 255,
    })
    description: string | null;

    @Column("char", {
        name: "create_by",
        nullable: true,
        comment: "创建人",
        length: 36,
    })
    createBy: string | null;

    @Column("datetime", {
        name: "create_time",
        nullable: true,
        comment: "创建时间",
    })
    createTime: Date | null;

    @Column("char", {
        name: "update_by",
        nullable: true,
        comment: "更新人",
        length: 36,
    })
    updateBy: string | null;

    @Column("datetime", {
        name: "update_time",
        nullable: true,
        comment: "更新时间",
    })
    updateTime: Date | null;
}
